#ifndef MODULEHPLCCMDID_H
#define MODULEHPLCCMDID_H

#include <QObject>

namespace hplc {

struct Input
{
    quint8 number;
    quint8 level;
};

struct Output
{
    quint8 number;
    quint8 level;
};

enum CommonCmdID
{
    // common
    CommonCmdID_SetDeviceAddress = 0,
    CommonCmdID_GetDeviceAddress,

    CommonCmdID_SetSoftwareVersion, // 主机没有
    CommonCmdID_GetSoftwareVersion,

    CommonCmdID_SetHardwareVersion, // 主机没有
    CommonCmdID_GetHardwareVersion,

    CommonCmdID_SetProductDate, // 主机没有
    CommonCmdID_GetProductDate,

    CommonCmdID_SetSerialNumber, // 主机没有
    CommonCmdID_GetSerialNumber,

    CommonCmdID_SetModel, // 主机没有
    CommonCmdID_GetModel,

    CommonCmdID_SetUsedTime, // 主机没有
    CommonCmdID_GetUsedTime,

    CommonCmdID_SetSyncTime,
    CommonCmdID_GetSyncTime,

    CommonCmdID_SetInput, // 主机没有
    CommonCmdID_GetInput,

    CommonCmdID_SetOutput,
    CommonCmdID_GetOutput,

    CommonCmdID_SetTick,

    CommonCmdID_SetTickPeriod,
    CommonCmdID_GetTickPeriod,

    CommonCmdID_SetSystemError, // 主机没有
    CommonCmdID_GetSystemError,

    CommonCmdID_SetSystemErrorUploadFreq,
    CommonCmdID_GetSystemErrorUploadFreq,

    _CommonCmdID_Max,
};

enum CommonSystemCmdID
{
    // system common
    CommonSystemCmdID_SetReset = _CommonCmdID_Max,

    CommonSystemCmdID_SetRestoreDefault,

    CommonSystemCmdID_SetSaveAsDefault,

    CommonSystemCmdID_SetSuperPassword,
    CommonSystemCmdID_GetSuperPassword,

    CommonSystemCmdID_SetSoftwareVersion, // 主机没有
    CommonSystemCmdID_GetSoftwareVersion,

    CommonSystemCmdID_SetHardwareVersion, // 主机没有
    CommonSystemCmdID_GetHardwareVersion,

    CommonSystemCmdID_SetProductDate,
    CommonSystemCmdID_GetProductDate,

    CommonSystemCmdID_SetSerialNumber,
    CommonSystemCmdID_GetSerialNumber,

    CommonSystemCmdID_SetModel,
    CommonSystemCmdID_GetModel,

    CommonSystemCmdID_SetModelString,
    CommonSystemCmdID_GetModelString,

    CommonSystemCmdID_SetUsedTime,
    CommonSystemCmdID_GetUsedTime,

    CommonSystemCmdID_GetAllData,

    CommonSystemCmdID_SetProtocol,
    CommonSystemCmdID_GetProtocol,

    CommonSystemCmdID_SetDebug,
    CommonSystemCmdID_GetDebug,

    CommonSystemCmdID_SetDebugPort,
    CommonSystemCmdID_GetDebugPort,

    CommonSystemCmdID_SetDebugVariants,
    CommonSystemCmdID_GetDebugVariants,

    _CommonSystemCmdID_Max,
};

enum DetectorCmdID
{
    DetectorCmdID_SetWave = _CommonSystemCmdID_Max,
    DetectorCmdID_GetWave,

    DetectorCmdID_SetWave2,
    DetectorCmdID_GetWave2,

    DetectorCmdID_SetTimeConst,
    DetectorCmdID_GetTimeConst,

    DetectorCmdID_SetRange,
    DetectorCmdID_GetRange,

    DetectorCmdID_SetLampType,
    DetectorCmdID_GetLampType,

    DetectorCmdID_SetChannel,
    DetectorCmdID_GetChannel,

    DetectorCmdID_SetLamp,
    DetectorCmdID_GetLamp,

    DetectorCmdID_SetZero,
    DetectorCmdID_GetZero,

    DetectorCmdID_SetHome,
    DetectorCmdID_GetHome,

    DetectorCmdID_SetAuUploadFreq,
    DetectorCmdID_GetAuUploadFreq,

    DetectorCmdID_SetAu,
    DetectorCmdID_GetAu,

    DetectorCmdID_SetWaveRefSam,
    DetectorCmdID_GetWaveRefSam,

    DetectorCmdID_SetWave2RefSam,
    DetectorCmdID_GetWave2RefSam,

    DetectorCmdID_SetScanCmd,
    DetectorCmdID_GetScanCmd,

    DetectorCmdID_SetScanAu,
    DetectorCmdID_GetScanAu,

    DetectorCmdID_SetScanParam,
    DetectorCmdID_GetScanParam,

    DetectorCmdID_SetLampUsedTime,
    DetectorCmdID_GetLampUsedTime,

    DetectorCmdID_SetStartStop,
    DetectorCmdID_GetStartStop,

    _DetectorCmdID_Max,
};

enum DetectorSystemCmdID
{
    DetectorSystemCmdID_SetCoil = _DetectorCmdID_Max,
    DetectorSystemCmdID_GetCoil,

    DetectorSystemCmdID_SetTimeIntegral,
    DetectorSystemCmdID_GetTimeIntegral,

    DetectorSystemCmdID_SetRangeIntegral,
    DetectorSystemCmdID_GetRangeIntegral,

    DetectorSystemCmdID_SetAuFactor,
    DetectorSystemCmdID_GetAuFactor,

    DetectorSystemCmdID_SetRasterStep,
    DetectorSystemCmdID_GetRasterStep,

    DetectorSystemCmdID_SetHomeOffset,
    DetectorSystemCmdID_GetHomeOffset,

    DetectorSystemCmdID_SetWaveOffset,
    DetectorSystemCmdID_GetWaveOffset,

    DetectorSystemCmdID_SetWorkMode,
    DetectorSystemCmdID_SetWorkModeWaveCalib,
    DetectorSystemCmdID_SetWorkModeDacCalib,
    DetectorSystemCmdID_GetWorkMode,

    DetectorSystemCmdID_SetWaveCalibData,
    DetectorSystemCmdID_GetWaveCalibData,

    DetectorSystemCmdID_SetWaveCalibDataCmd,
    DetectorSystemCmdID_GetWaveCalibDataCmd,

    DetectorSystemCmdID_SetLampUsedTime,
    DetectorSystemCmdID_GetLampUsedTime,

    DetectorSystemCmdID_SetLampOnOffTimes,
    DetectorSystemCmdID_GetLampOnOffTimes,

    DetectorSystemCmdID_SetLampCount,
    DetectorSystemCmdID_GetLampCount,

    DetectorSystemCmdID_SetDacZeroVoltage,
    DetectorSystemCmdID_GetDacZeroVoltage,

    DetectorSystemCmdID_SetUploadObject,
    DetectorSystemCmdID_GetUploadObject,

    DetectorSystemCmdID_SetHomeTimeIntegral,
    DetectorSystemCmdID_GetHomeTimeIntegral,

    DetectorSystemCmdID_SetHomeRangeIntegral,
    DetectorSystemCmdID_GetHomeRangeIntegral,


    _DetectorSystemCmdID_Max,
};

enum PumpCmdID
{
    PumpCmdID_SetFlow = _CommonSystemCmdID_Max,
    PumpCmdID_GetFlow,

    PumpCmdID_SetFlowPercent,
    PumpCmdID_GetFlowPercent,

    PumpCmdID_SetPressureMin,
    PumpCmdID_GetPressureMin,

    PumpCmdID_SetPressureMax,
    PumpCmdID_GetPressureMax,

    PumpCmdID_SetPressureWarning,
    PumpCmdID_GetPressureWarning,

    PumpCmdID_SetStartStop,
    PumpCmdID_GetStartStop,

    PumpCmdID_SetPauseRestore,
    PumpCmdID_GetPauseRestore,

    PumpCmdID_SetPurge,
    PumpCmdID_GetPurge,

    PumpCmdID_SetPurgeFlow,
    PumpCmdID_GetPurgeFlow,

    PumpCmdID_SetPurgeTime,
    PumpCmdID_GetPurgeTime,

    PumpCmdID_SetPressZero,
    PumpCmdID_GetPressZero,

    PumpCmdID_SetPressUploadFreq,
    PumpCmdID_GetPressUploadFreq,

    PumpCmdID_SetFlowPressCompen,
    PumpCmdID_GetFlowPressCompen,

    PumpCmdID_SetMode,
    PumpCmdID_GetMode,

    PumpCmdID_SetPressure,
    PumpCmdID_GetPressure,

    PumpCmdID_SetRunMode,
    PumpCmdID_GetRunMode,

    // CP,即const pressure,恒压泵专用
    PumpCmdID_Set_CP_FlowMax,
    PumpCmdID_Get_CP_FlowMax,

    PumpCmdID_Set_CP_FlowMin,
    PumpCmdID_Get_CP_FlowMin,

    PumpCmdID_Set_CP_PressThreshold,
    PumpCmdID_Get_CP_PressThreshold,

    PumpCmdID_Set_CP_Press,
    PumpCmdID_Get_CP_Press,

    PumpCmdID_Set_CP_PID,
    PumpCmdID_Get_CP_PID,

    PumpCmdID_Set_CP_PressPidOut,
    PumpCmdID_Get_CP_PressPidOut,

    PumpCmdID_Set_CP_PressPidOutUploadFreq,
    PumpCmdID_Get_CP_PressPidOutUploadFreq,

    _PumpCmdID_Max,
};

enum PumpSystemCmdID
{
    PumpSystemCmdID_SetWorkModePressureCalib = _PumpCmdID_Max,
    PumpSystemCmdID_SetWorkModeRateCalib,
    PumpSystemCmdID_SetWorkModePulseCompenCalib,
    PumpSystemCmdID_SetWorkModeMotorCurrentCalib,
    PumpSystemCmdID_SetWorkMode,
    PumpSystemCmdID_GetWorkMode,

    PumpSystemCmdID_SetFlowCalibDataCmd,
    PumpSystemCmdID_SetFlowCalibData,
    PumpSystemCmdID_GetFlowCalibData,

    PumpSystemCmdID_SetFlowCalibLoadParam, // zkys
    PumpSystemCmdID_GetFlowCalibLoadParam, // zkys

    PumpSystemCmdID_SetFlowCalibLoadFlow,
    PumpSystemCmdID_GetFlowCalibLoadFlow,

    PumpSystemCmdID_SetFlowCalibLoadRealFlow,
    PumpSystemCmdID_GetFlowCalibLoadRealFlow,

    PumpSystemCmdID_SetFlowCalibLoadPress,
    PumpSystemCmdID_GetFlowCalibLoadPress,

    PumpSystemCmdID_SetPressCalibDataCmd,
    PumpSystemCmdID_SetPressCalibData,
    PumpSystemCmdID_GetPressCalibData,

    PumpSystemCmdID_SetPulseCompenCalibDataCmd,
    PumpSystemCmdID_SetPulseCompenCalibData,
    PumpSystemCmdID_GetPulseCompenCalibData,

    PumpSystemCmdID_SetPulseCompenDebugCmd,
    PumpSystemCmdID_SetPulseCompenGear,
    PumpSystemCmdID_SetPulseCompenGearPos,

    PumpSystemCmdID_SetStepMotorIRun,
    PumpSystemCmdID_GetStepMotorIRun,

    PumpSystemCmdID_SetMotorCurrentCalibDataCmd,
    PumpSystemCmdID_SetMotorCurrentCalibData,
    PumpSystemCmdID_GetMotorCurrentCalibData,

    PumpSystemCmdID_SetMotorControlMode,
    PumpSystemCmdID_GetMotorControlMode,

    PumpSystemCmdID_SetMotorDivFreq,
    PumpSystemCmdID_GetMotorDivFreq,

    PumpSystemCmdID_SetMotorFSPR,
    PumpSystemCmdID_GetMotorFSPR,

    PumpSystemCmdID_SetMotorCurrentStandby,
    PumpSystemCmdID_GetMotorCurrentStandby,

    PumpSystemCmdID_SetPumpMaterial,
    PumpSystemCmdID_GetPumpMaterial,

    PumpSystemCmdID_SetCurrentRpm,
    PumpSystemCmdID_GetCurrentRpm,

    _PumpSystemCmdID_Max,
};

} // hplc

Q_DECLARE_METATYPE(hplc::Input);
Q_DECLARE_METATYPE(hplc::Output);

#endif // MODULEHPLCCMDID_H
